package cn.javacc.system.service;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.javacc.system.dao.UserTrackingDao;
import cn.javacc.system.domain.UserTracking;

@Service
public class UserTrackingService {
	@Inject
	private UserTrackingDao userTrackingDao;

	public UserTracking getUserTrackingById(Long id) {
		return this.userTrackingDao.get(id);
	}

	public List<UserTracking> listUserTrackings(int offset, int fetchSize) {
		return this.userTrackingDao.findAll(offset, fetchSize);
	}

	public int getUserTrackingTotalSize() {
		return this.userTrackingDao.getTotalSize();
	}

	@Transactional
	public void saveUserTracking(UserTracking userTracking) {
		this.userTrackingDao.save(userTracking);
	}

	@Transactional
	public void updateUserTracking(UserTracking userTracking) {
		this.userTrackingDao.update(userTracking);
	}

	@Transactional
	public void deleteUserTracking(Long id) {
		this.userTrackingDao.delete(id);
	}
}
